package com.ljj.bitetime.item

import android.os.Parcelable
import kotlinx.parcelize.Parcelize

/**
 * 店铺数据类
 * @param id 店铺唯一标识
 * @param name 店铺名称
 * @param description 店铺描述
 * @param rating 店铺评分
 * @param imageRes 店铺图片资源路径
 */
@Parcelize
data class Shop(
    val id: Int,
    val name: String,
    val description: String? = null,
    val rating: Double? = null,
    val imageRes: String? = null
) : Parcelable {
    init {
        require(rating == null || rating in 0.0..5.0) { "评分必须在0.0到5.0之间" }
    }
}